package rsj.interceptor;

import com.rlyy.aibase.utils.base.Box;

/**
 * 通过装饰模式、对拦截校验做增强扩展
 * 所有拦截校验实现类 实现此装饰器 重写preHandle
 *
 * @author yuanqinglong
 * @since 2021/5/28 10:57
 */
public abstract class MyDecorator implements MyInterceptor {

    /**
     * 校验器
     */
    private final MyInterceptor myInterceptor;


    protected MyDecorator(MyInterceptor myInterceptor) {
        this.myInterceptor = myInterceptor;
    }


    @Override
    public boolean preHandle(Box in) throws Exception {
        return myInterceptor.preHandle(in);
    }
}
